package com.oromwin.repos.server.request;

import java.sql.Timestamp;

import org.apache.commons.logging.Log;

import com.oromwin.repos.common.Common;
import com.oromwin.repos.common.Server;
import com.oromwin.repos.common.Logger;
import com.oromwin.repos.common.ReposException;
import com.oromwin.repos.data.FileTable;
import com.oromwin.repos.data.MediaTable;
import com.oromwin.repos.data.VolumeTable;

public abstract class AbstractRequest implements Request, RequestAction {
    private Log log = Logger.getLog(AbstractRequest.class);
    private String _uuid = null;
    private Timestamp _timestamp = null;
    protected VolumeTable _volumeTable = null;
    protected MediaTable _mediaTable = null;
    protected FileTable _fileTable = null;
    
    public AbstractRequest() {
        _uuid = Server.UniqueId.generate();
        _timestamp = new Timestamp(System.currentTimeMillis());
    }
    
    public String id() {
        return _uuid;
    }
    
    public Timestamp timestamp() {
        return _timestamp;
    }

    @Override
    public void checkDependentObjectNotExists() throws ReposException {
        throw ReposException.create(log, Common.Message.NOT_IMPLEMENTED_METHOD_INVOKE);
    }

    @Override
    public void checkFreeSpaceExists() throws ReposException {
        throw ReposException.create(log, Common.Message.NOT_IMPLEMENTED_METHOD_INVOKE);
    }

    @Override
    public void checkSameObjectExists() throws ReposException {
        throw ReposException.create(log, Common.Message.NOT_IMPLEMENTED_METHOD_INVOKE);
    }

    @Override
    public void getCurrentReposTables() throws ReposException {
        throw ReposException.create(log, Common.Message.NOT_IMPLEMENTED_METHOD_INVOKE);
    }
}
